<template>
    <div class="layout">
        <div class = "header">
            <p style="color:white;font-size:35px;text-align:center;line-height:100px;">秦皇岛市企业融资服务平台</p>
        </div>
        <div class = "centent">
            <p>邮箱认证</p>
        </div>
        <div class = "hint">
            <p>{{this.message}}</p>
            <Button style="background-color:#1d7ba7;width:50%;height:50px;margin-left:25%;margin-top:14%;font-size:25px;color:white;" @click = "handleBackHome()">返回首页</Button>
        </div>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                url:unescape(window.location.href),
                data:[
                    {id:''},
                    {time: '0000000000000'},
                    {email: ''},
                    {code: ''}
                ],
                message: "",
            }
        },
        methods: {
            handleBackHome() {
                this.$router.push({
                    name: "index"
                });
            }
        },
        created() {
            var param;
            param = this.url.split('?');
            var element;
            element = param[1].split('&');
            this.data.id = (element[0].split('='))[1];
            this.data.code = (element[1].split('='))[1];
            this.data.time = (element[2].split('='))[1];
            this.data.email = (element[3].split('='))[1];
            this.api.post("authEmail/check_email",{id:this.data.id, email:this.data.email, code:this.data.code, time:this.data.time}, res => {
                this.message = res.message;
            });
        }
    
    }
</script>
<style scoped>
    .header {
    background: #1d7ba7;
    padding: 0 50px;
    height: 100px;
    line-height: 64px;
    position: fixed;
    width: 100%;
    }
    .centent {  
        padding-top:100px;
        width:90%;
        height: 200px;
        margin-left: 5%;
        margin-right: 5%;
        border-bottom: 1px solid black;
        font-size:32px;
    }
    .centent p {
        padding-top:25px;
    }
    .hint {
        width:50%;
        margin-left: 25%;
        margin-right: 25%;
        font-size: 35px;
        padding-top:15%;
    }
    .hint p {
        text-align:center; 
    }
</style>